package com.example.wxback.service;

import com.example.wxback.dao.IUserMessageDetailDao;
import com.example.wxback.model.MessageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserMessageDetailService {

    @Autowired
    private IUserMessageDetailDao userMessageDetailDao;

    /**
     * 插入消息
     */
    public boolean insertMessage(MessageInfo messageInfo) {
        return userMessageDetailDao.insertMessage(messageInfo) > 0;
    }

    /**
     * 插入消息
     */
    public List<MessageInfo> getMessageList(int conversationId) {
        return userMessageDetailDao.getMessageList(conversationId);
    }
}
